-
Notifications
You must be signed in to change notification settings - Fork 38.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip runtime hint registration for validation constraint with missing dependencies #33949
Conversation
04886d0
to
8753789
Compare
I still think that we should avoid forwarding bean types of |
Thanks for the reminder, @odrotbohm! While working on this PR, I completely forgot about #33940 (comment), sorry about that. I just pushed a possible solution for beans with @sbrannen mentioned that he plans to discuss this change with the team next week. |
The role infrastructure looks a little bit arbitrary to me. I'd prefer if we use a signal that's more direct to the task at hand. |
Thanks for the suggestion. We can keep things as they are or drop the commit based on what the team decides. |
Hi folks - do you know if there is any workaround for this issue? Currently it blocks an upgrade to SB 3.4.0. Removing the |
As an interim workaround (before 6.2.1 is released), you should hopefully be able to add the dependencies causing the problem. For example, if you're seeing Please let us know if that works for you. |
Team Decision: Merge the PR without the |
The log message for a NoClassDefFoundError is now a DEBUG level message handled like a TypeNotPresentException and similar to the following. DEBUG: Skipping validation constraint hint inference for class org.example.CustomConstraint due to a NoClassDefFoundError for com.example.MissingType See gh-33949
@edeandrea I can confirm that in an empty project with Just bringing the dependency might cause side effects with auto configurations like |
Thank you @scordio - adding |
Does not appear to work. I added it like follows:
But I still get this error:
The error pops up when submitting a request to the application. Spring version is 3.3.7. |
Update to my previous comment: I fixed it by adding these to build.gradle:
And then deleting |
@simaotwx I don't think your problem is related to this issue. This issue was fixed in Spring Framework 6.2.1, a regression introduced in 6.2.0. Spring Boot 3.3.7 uses Spring Framework 6.1.x. Also, the stacktrace indicates that this problem is happening while invoking a controller method, while this issue is about AOT processing at build time. Maybe a controller in your application is exposing a reactive type somehow and the dependency management of your application is incomplete? Maybe a library is exposing reactive support and you didn't intend to activate it? If you can reproduce the problem with a minimal sample application, please share it with us by creating a new issue. |
Prior to this commit, AOT processing for bean validation failed with
NoClassDefFoundError
for constraints with missing dependencies. With this change, the processing no longer fails, and a warning is logged instead.NoClassDefFoundError
#33940Example Log Message